package com.dx.spring6_15.lifeTime;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class MyBean implements BeanPostProcessor {

	
	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		System.out.println("After ..." + bean + "  " + beanName);
		return bean;
	}

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		System.out.println("Before ..." + bean + "  " + beanName);
		
		// 可经换掉 Bean  所有的Bean ,可以使用 if 判断
		
		return bean;
	}

}
